package icu.xuyijie.springbootlearning2.chapter4.async;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * @author 徐一杰
 * @date 2025/03/07 10:42
 * @description 测试Springboot的注解异步方法
 */
@Component
public class AsyncTest {

    @Async
    public void method1() {
        try {
            Thread.sleep(10000);
            System.out.println(Thread.currentThread().getName() + "执行完毕");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

}
